package 线性查找;

import java.util.Objects;

public class Student {
    private String name;

    public Student(String name) {
        this.name = name;
    }


    @Override
    public boolean equals(Object o ){
        /*如果两个对象是一个对象*/
        if (this == o){
            return true;
        }
        /*如果传来的是空*/
        if ( o== null){
            return false;
        }
        /*
        * 比较两个对象的类型*/
        if (this.getClass() != o.getClass()){
            return false;
        }
        Student student = (Student)o;
        /*全部改为小写
        * */
        return this.name.toLowerCase().equals(student.name.toLowerCase());
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }
}
